<div class="path"><i class="iconfont">&#xf108;</i>  <a href="{url('admin/default/welcome')}">开始</a> {$sitename} / <a href="{url('index/index')}">内容管理</a>{$path}</div>
<div class="m10">
<div class="table-head fn-clear">
<div class="fn-l"><a href="###" class="button tipa"> <i class="iconfont">&#xf0ca;</i> 栏目</a><strong>内容列表</strong></div>
<div class="fn-r">
    <span class="button button-blue tipb" ><i class="iconfont">&#xf055;</i> 增加内容 <i class="iconfont">&#xf0d7;</i> </span>
    <span id="checkall" class="button button-blank"><i class="iconfont">&#xf046;</i> 全选</span>
    <span id="checktog" class="button button-blank"><i class="iconfont">&#xf045;</i> 反选</span>
    <span id="checkoff" class="button button-blank"><i class="iconfont">&#xf05c;</i> 取消</span>
    <span onclick="myform.submit()" class="button button-blank"><i class="iconfont">&#xf014;</i> 删除</span>
</div>
</div>
<div class="select-list"><ul class="ztree">{model('channel')->ClassTree($root,'index/index',$website_id)}</ul></div>
<div class="select-add"><ul class="ztree">{model('channel')->ClassTree($root,'index/add',$website_id)}</ul></div>
<table class="table">
<form id="myform" action="{url('index/index',array('act'=>'alldel'))}" method="post">
<thead><tr><th class="w10 fn-tac"><input id="all" type="checkbox" name="all" value="all" /></th><th class="fn-tal">内容标题</th><th class="w60 fn-tac">阅读量</th><th class="w50 fn-tac">排序</th><th class="w50 fn-tac">状态</th><th class="w120 fn-tac">更新时间</th><th class="w140 fn-tac">操作</th></tr></thead>
<tbody>
{loop $list $vo}
<tr>
    <td class="fn-tac"><input cssrain="one" type="checkbox" name="fid[]" value="{$vo['id']}" /></td>
    <td class="ext">[ <span class="fn-fb">{$vo['channel_name']}</span> ] <i class="iconfont">&#xf0da;</i> <a title="{$vo['title']}" href="{url('index/edit',array(id=>$vo['id']))}">{if $vo['fontcolor']}<span style="color:{$vo['fontcolor']}">{/if}{$vo['title']}{if $vo['fontcolor']}</span>{/if}</a> {model('index')->exts_Count($vo['channel_id'],$vo['id'])}</td>
    <td class="fn-tac">{$vo['views']}</td>
    <td class="fn-tac">{if $vo['sort']}<span class="badge bg-blue">手动</span> {else}<span class="badge">自动</span>{/if}</td>
    <td class="fn-tac"><span class="goto pt" uid="{$vo['id']}" state="{$vo['status']}">{if $vo['status']}<span class="badge bg-blue state_{$vo['id']}">已审</span>{else}<span class="badge bg-red state_{$vo['id']}">未审</span>{/if}</span></td>
    <td class="fn-tac">{date('Y-m-d H:i:s',$vo['uptime'])}</td>
    <td class="fn-tac tip">
        <a title="预览" href="{url('default/read',array(uid=>$vo['id']))}" target="_blank">预览</a> / 
        <a title="编辑" href="{url('index/edit',array(id=>$vo['id']))}">编辑</a> / 
        <a class="del" title="删除" href="###" url="{url('index/index',array(id=>$vo['id'],act=>del))}">删除</a>
    </td>
</tr>
{/loop}
</tbody>
</form>
</table>
<div id="page" class="fn-clear">{$pager}</div>
</div>
<script type="text/javascript">
Do('base','dialog','tip','tree',function(){
//状态操作
$(".goto").click(function(){
    var uid = $(this).attr('uid');
    var state = $(this).attr('state');
    var __this= this;
    $.get("{url('index/state')}",{uid:uid},function(data){
        if(data == 'ok'){
            $.dialog.tips('操作成功！', 1.5);
            if(state == 1){
              $('.state_'+uid).removeClass("bg-blue").addClass("bg-red");
              $(__this).attr("state", "0"); 
            }else{
              $('.state_'+uid).removeClass("bg-red").addClass ("bg-blue");
              $(__this).attr("state", "1"); 
            }
        }else{
            $.dialog.tips('操作失败！', 1.5);
        }
    })
})
//全选
$("#all").click(function() {
    if (this.checked == true) {
        $("input[cssrain='one']").checked("on");
    } else {
        $("input[cssrain='one']").checked("off");
    }
});
$("#checkall").click(function() {$("input[cssrain='one']").checked("on");});
$("#checkoff").click(function() {$("input[cssrain='one']").checked("off");});
$("#checktog").click(function() {$("input[cssrain='one']").checked("toggle");});
//删除
$('.del').click(function(){$(this).del();});
$(".tipa").powerFloat({target: $(".select-list")});
$(".tipb").powerFloat({target: $(".select-add")});
$(".ztree").treeview({collapsed: true,animated: "medium",control:"#sidetreechannel",persist: "location"});
})
</script>